﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransCend.DAL;
using TransCend.DB;
using TransCend.Model;
using TransCend.Util.Page;

namespace TransCend.Service
{
    public interface IBaseService<T> where T : BaseModel
    {
        T FindByID(int id);
        T FindByProperty(string propertyname, object propertyvalue);
        int Insert(T model);
        int InsertReturnId(T model);
        int Update(T model);
        int Merge(T model);
        int Delete(int id);
        int Delete(int[] ids);
        IList<T> FindAll(params OrderBy[] orderBy);
        IList<T> FindList(T queryModel, params OrderBy[] orderBy);
        IList<T> FindList(int[] ids, params OrderBy[] orderBy);
        PageTools<T> FindPage(int page, int rows, OrderBy[] orderBy);
        PageTools<T> FindPage(int page, int rows, T queryModel, OrderBy[] orderBy);
        DateTime FindNowDate();
        int FindListCount(T queryModel);
    }
}
